import React from 'react'; 
import {Link} from 'react-router';  
export default React.createClass({
    getInitialState: function () {
        return {};
	},					
	handleSearch: function() {	
        var keyword = $("#keyword").val();
		this.props.history.pushState({keyword: keyword}, "/search");
	},
    handleKeyDown:function(event) {
        if (event.keyCode == 13){               
           $('#btn-search').trigger("click");
           event.preventDefault();
        }
    },  
    componentDidMount: function(){
        $('.input-daterange').datepicker({
        });
    },
    render: function(){ 
    	return(        		
		    <div className="search_a7">
		        <div className="input-group">
		                <input onKeyDown={this.handleKeyDown} id="keyword" name="keyword" type="text" className="form-control"/>
		                <i className="fa fa-caret-down sea_look" data-toggle="collapse" data-target="#search_hide_choice"></i>
		                <div id="btn-search" onClick={this.handleSearch} className="input-group-btn">			                
		                    <div className="btn btn-white fa fa-search"></div>
		                </div>
		        </div>
		        <div className="panel-collapse collapse" id="search_hide_choice" aria-expanded="false" style={{height:'0px'}}>
		            <div className="search_hide_choice">
		                <section className="">
		                    <div className="panel-body">
		                                <div className="panel-body">
		                                    <form role="form">
                                                <div className="form-group row">
                                                    <label className="col-xs-3">创建时间：</label>
                                                    <div className="col-xs-9">
                                                        <div className="input-daterange input-group">
                                                            <input type="text" className="input-sm form-control " name="start" />
                                                            <span className="input-group-addon">to</span>
                                                            <input type="text" className="input-sm form-control " name="end" />
                                                        </div>
                                                    </div>
                                                </div>
                                                <div className="form-group row">
                                                    <label className="col-xs-3">最近更新时间：</label>
                                                    <div className="col-xs-9">
                                                        <div className="input-group input-daterange">
                                                            <input type="text" className="input-sm form-control" name="start" />
                                                            <span className="input-group-addon">to</span>
                                                            <input type="text" className="input-sm form-control" name="end" />
                                                        </div>
                                                    </div>
                                                </div>
                                                <div className="form-group row">
                                                    <label className="col-xs-3">文档格式：</label>
                                                    <div className="col-xs-8">
                                                        <select className="form-control">
                                                            <option>1</option>
                                                            <option>2</option>
                                                            <option>3</option>
                                                            <option>4</option>
                                                            <option>5</option>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div className="form-group row">
                                                    <label className="col-xs-3">文档类别：</label>
                                                    <div className="col-xs-8">
                                                        <select className="form-control">
                                                            <option>1</option>
                                                            <option>2</option>
                                                            <option>3</option>
                                                            <option>4</option>
                                                            <option>5</option>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div className="form-group row">
                                                    <label className="col-xs-3">属性1：</label>
                                                    <div className="col-xs-9">
                                                        <input type="text" className="form-control" placeholder=""/>
                                                    </div>
                                                </div>
                                                <div className="form-group row">
                                                    <label className="col-xs-3">属性2：</label>
                                                    <div className="col-xs-9">
                                                        <input type="text" className="form-control" placeholder=""/>
                                                    </div>
                                                </div>
                                                <div className="form-group row">
                                                    <label className="col-xs-3">属性3：</label>
                                                    <div className="col-xs-9">
                                                        <input type="text" className="form-control" placeholder=""/>
                                                    </div>
                                                </div>
		                                        <div className="form-group text-right">
		                                            <button className="btn btn-white" type="button">重设</button>
		                                            <button className="btn btn-white m-left25" type="button"> <a href="doc_search.html" className="fa fa-search">搜索</a></button>
		                                        </div>
		                                    </form>
		                                </div>
		                    </div>
		                </section>
		            </div>
		        </div>
		    </div>		    	
	    )
	}
})
	

